#ifndef DX11SHADERMANAGER_H
#define DX11SHADERMANAGER_H

#include "Singleton.h"
#include <map>
#include <string>
#include <Windows.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dcompiler.h>
#include <D3DX10math.h>

class DX11ShaderManager : public Uncopyable
{
	DX11ShaderManager();
	friend class Singleton<DX11ShaderManager>;
public:
	HRESULT LoadShader(std::string shaderName, const std::wstring& filename, const LPCSTR& psName, const LPCSTR& vsName);
	std::pair<ID3D11VertexShader*, ID3D11PixelShader*>& UseShader(std::string shaderName);
	HRESULT CompileShaderFromFile(std::string shaderName, WCHAR* szFileName, LPCSTR szEntryPoint, LPCSTR szShaderModel, ID3DBlob** ppBlobOut);

	ID3D11VertexShader* GetVertShader(std::string shaderName);
	ID3D11PixelShader* GetPixShader(std::string shaderName);

	bool ReleaseShaders();
	void ResetShaders();
	void ResetResources();

	
private: // private functions

private: // private variables
	std::map<std::string, ID3D11VertexShader*> m_vShaders;
	std::map<std::string, ID3D11PixelShader*> m_pShaders;
	std::map<std::string, ID3D11Buffer*> m_constBuffer;
};

typedef Singleton<DX11ShaderManager> TheDX11ShaderManager;

#endif SHADERMANAGER_H